package View;

/**
 * Classe responsavel pelo conteudo exibido na tela durante o jogo.
 * 
 * @author Edjane Catolle, Igor Henrique, Luiz Augusto, Vladmir Chicarolli
 * @version 1.0.0
 * @since 05/31/2011
 */

import Model.ImagesManager;
import Model.Map;

public class GameView extends BaseView 
{
	public PlayerView player;
	public SheepView sheep;
	public ZombieView zombie;
	public ItemView item;
	
	private boolean newWave;
	private boolean getReady;
	private boolean start;
	private boolean endGame;
	
	public GameView()
	{
		player = new PlayerView();
		sheep = new SheepView();
		zombie = new ZombieView();
		item = new ItemView();
		
		newWave = false;
		getReady = false;
		start = false;
		endGame = false;
	}
	@Override
	public void DrawHandler() 
	{
		if(endGame)
		{
			buffer = ImagesManager.LoadImage(ImagesManager.endGameSRC);
			DrawBuffer();
		}
		else
		{
			buffer = Map.GetMap();
			DrawBuffer();
			
			player.DrawHandler();
			sheep.DrawHandler();
			zombie.DrawHandler();
			item.DrawHandler();
			if(newWave)
			{
				buffer = ImagesManager.LoadImage(ImagesManager.newWaveMSG);
				DrawBuffer();
			}
			
			if(getReady)
			{
				buffer = ImagesManager.LoadImage(ImagesManager.getReadyMSG);
				DrawBuffer();
			}
			
			if(start)
			{
				buffer = ImagesManager.LoadImage(ImagesManager.startMSG);
				DrawBuffer();
			}
		}
	}
	
	public void SetPopupNewWave(boolean setPopup)
	{
		this.newWave = setPopup;
	}
	
	public void SetPopupGetReady(boolean setPopup)
	{
		this.getReady = setPopup;
	}
	
	public void SetPopupStart(boolean setPopup)
	{
		this.start = setPopup;
	}
	
	public void SetEndGame(boolean setPopup)
	{
		this.endGame = setPopup;
	}
}
